const postcss = require("postcss");
const CONFIG = require("./config.json");
const OPTIONS = require("./config");

module.exports = postcss.plugin("postcss-uni-tailwind", (opts = {}) => root => {
  const _opts = { ...OPTIONS, ...opts };
  const _platform = _opts.platform;
  const _config = CONFIG[_platform];

  require(`./walkrule.${_platform}`)(_config, root, _opts);
  require("./unit")(root, _opts);
});
